<template>
	<view>
		<view style="position: relative" v-for="(item,index) in activeDataList" @click="activityDetail(item.id,item)">
			<image :src="image+item.img" mode="" style="height: 350rpx;width: 100%;" class="bg-gray"></image>
			<view class="padding-sm bg-white">
				{{item.title}}
				<text class="text-gray" style="position: absolute;right: 10rpx;"> {{item.addtime}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp().globalData
	import {
		activeList
	} from '../../../common/path.js'
	export default {
		data() {
			return {
				activeDataList:[]
			}
		},
		onShow() {
			this.image = app.image
			this.activeList()
		},
		methods: {
			//活动列表
			activeList() {
				this.$axios.axios('POST', activeList, {})
					.then(res => {
						console.log('驾校活动列表-', res)
						if (res.status) {
						this.activeDataList = res.data
						}
					})
					.catch(err=>{
						console.log(err);
					})
			},
			//获取详情
			
			activityDetail(id,item) {
			uni.navigateTo({
				url:'/pages/home/activity/activityDetail?id=' +id+'&detail=' +JSON.stringify(item)
			})
			}
		}
	}
</script>

<style>
</style>
